#ifndef UDP_SERVER_H
#define UDP_SERVER_H

#include "NetworkInterface.h"
#include <winsock2.h>
#include <string>

class UdpServer : public INetwork {
public:
    UdpServer();
    ~UdpServer() override;

    bool Initialize(const std::string& ip, int port) override;
    bool Send(const std::string& data, const std::string& targetIp, int targetPort) override;
    bool Receive(std::function<void(const std::string&, const std::string&, int)> callback) override;
    void Close() override;
    std::string GetError() const override;

private:
    SOCKET server_fd;
    std::string error_msg;
};

#endif